home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Leonardo the Inventor
/
Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso
/
LEOWINMV
/
SHARED.DIR
/
03084_Script_PRINT LEO II B
< prev
next >
Wrap
Text File
|
1996-04-01
|
10KB
|
320 lines
-- ----------------------------------------------------------------
-- Handler doPrintDataBaseText does the actual printing of the text
-- of the selected topic in the database.
on doPrintDatabaseText printObj
global textSprite, numPagesInClickedTopic, clickedTopic
printobj(mSetDocumentName, "Leonardo 2")
set width = printObj(mGetPageWidth)
set height = printObj(mGetPageheight)
-- printObj(mSetPageNumSymbol,"#")
printObj(mreset)
printObj(mSetTextFont,"helvetica")
printObj(mSetTextSize,18)
printObj(mSetTextStyle,"normal,italic")
-- page header left side
printObj(mSetTextJust,"left")
printObj(mDrawText, clickedTopic, 0, 8)
-- page header line underneath
printObj(mLine, 0, 11, width, 11)
-- page footer right side
-- printObj(mSetTextSize,10)
-- printObj(mSetTextStyle,"normal")
-- printObj(mDrawText, "page #", width, height-2)
-- page footer left side: copyright notice
printObj(mSetTextSize,10)
printObj(mSetTextStyle,"normal")
printObj (mSetTextJust,"left")
printObj (mDrawText,"⌐1996 SoftKey Multimedia Inc., a subsidiary of SoftKey International Inc.",0,height-2)
-- the body pages
printObj(mSetTextJust,"left")
printObj(mNewPage)
printObj(mTextBox, 0, 30, width, height-24, true)
printObj(mSetColor,255,0,0)
printObj(mSetTextStyle,"normal")
printObj(mSetTextSize,12)
printObj(mSetGray,100)
repeat with curPage = 1 to numPagesInClickedTopic
set currentPageText = the text of cast (clickedTopic && "TEXT" & curPage)
set numLines = the number of lines in currentPageText
if (line numLines of currentPageText = EMPTY) then
set currentPageText = line 1 to numLines - 1 of currentPageText & " "
end if
if endsWithPunctuation(currentPageText) then
set currentPageText = currentPageText && " "
end if
printObj(mAppendText, currentPageText, TRUE)
end repeat
-- register the xobject
printobj(mRegister, "PMAT130-013-01075")
-- printObj(mPrintPreview)
printObj(mPrint)
printObj(mDispose)
end
-- ----------------------------------------------------------------
-- Handler doPrintDataBasePicture does the actual printing of the
-- picture of the selected topic in the database.
on doPrintDatabasePicture printObj
global pictureSprite, clickedTopic, captionSprite
doPrintPicture(printObj, the castNum of sprite pictureSprite, clickedTopic, the text of cast the castnum of sprite captionSprite)
end
----------------------------------------------------------------
-- Handler doPrintBGPicture prints the picture in the given pictureCast
-- with the given pictureTitle and the optional pictureCapiton
-- NOTE: THIS VERSION PRINTS LARGE PICTURES IN LANDSCAPE MODE
-- SCALED DOWN TO %75.
on doPrintBGPicture printObj, pictureCast, pictureTitle, pictureCaption
printobj(mSetDocumentName, "Leonardo 2")
printObj(mreset)
printobj(msetlandscapemode, TRUE)
set width = printObj(mGetPageWidth)
set height = printObj(mGetPageheight)
printObj(mSetTextFont,"Times")
printObj(mSetTextSize,18)
printObj(mSetTextStyle,"normal")
-- page header left side
if not(voidP(pictureTitle)) then
printObj(mSetTextJust,"left")
printObj(mDrawText, pictureTitle, 0, 8)
end if
-- page header line underneath
printObj(mLine, 0, 11, width, 11)
-- page footer left side
printObj(mSetTextSize,10)
printObj (mSetTextJust,"left")
printObj(mSetTextStyle,"normal")
printObj (mDrawText,"⌐1996 SoftKey Multimedia Inc., a subsidiary of SoftKey International Inc.",0,height-5)
-- place the picture on the page
set pictureWidth = the width of cast pictureCast
set pictureHeight = the height of cast pictureCast
-- center the picture
set topP = (height / 2) - (pictureHeight / 2)
set bottomP = (height / 2) + (pictureHeight / 2)
set rightP = (width / 2) + (pictureWidth / 2)
set leftP = (width / 2) - (pictureWidth / 2)
-- scale the picture if necessary
if (pictureHeight >= 430) then -- too big to print 100%, scale down to 75%
set topP = integer(topP + 0.125 * pictureHeight)
set bottomP = integer(bottomP - 0.125 * pictureHeight)
set leftP = integer(leftP + 0.125 * pictureWidth)
set rightP = integer(rightP - 0.125 * pictureWidth)
end if
-- place the caption on the page
if not(voidP(pictureCaption)) then
printObj(mSetTextJust,"left")
printObj(mSetTextSize,14)
printObj(mSetTextStyle,"normal,italic")
printObj(mDrawText, pictureCaption, 0, 30)
end if
printObj(mNewPage)
printObj(mPicture, the picture of cast pictureCast, leftP, topP, rightP, bottomP)
-- register the xobject
printobj(mRegister, "PMAT130-013-01075")
-- printObj(mPrintPreview)
printObj(mprint)
printObj(mDispose)
end
-- NOTE: THIS VERSION PRINTS LARGE PICTURES NOT IN LANDSCAPE MODE
on doPrintPicture printObj, pictureCast, pictureTitle, pictureCaption
set pictureWidth = the width of cast pictureCast
set pictureHeight = the height of cast pictureCast
if (pictureHeight >= 430) and (pictureWidth >= 600) then -- must print landscape
doPrintBGPicture printObj, pictureCast, pictureTitle, pictureCaption -- reduce to 75%
exit
end if
printobj(mSetDocumentName, "Leonardo 2")
printObj(mreset)
if (pictureHeight >= 430) then -- too big to print landscape
printobj(msetlandscapemode, FALSE)
else
printobj(msetlandscapemode, TRUE)
end if
set width = printObj(mGetPageWidth)
set height = printObj(mGetPageheight)
printObj(mSetTextFont,"Times")
printObj(mSetTextSize,18)
printObj(mSetTextStyle,"normal")
-- page header left side
if not(voidP(pictureTitle)) then
printObj(mSetTextJust,"left")
printObj(mDrawText, pictureTitle, 0, 8)
end if
-- page header line underneath
printObj(mLine, 0, 11, width, 11)
-- page footer left side
printObj(mSetTextSize,10)
printObj (mSetTextJust,"left")
printObj(mSetTextStyle,"normal")
printObj (mDrawText,"⌐1996 SoftKey Multimedia Inc., a subsidiary of SoftKey International Inc.",0,height-5)
-- place the picture on the page
-- center the picture
set topP = (height / 2) - (pictureHeight / 2)
set bottomP = (height / 2) + (pictureHeight / 2)
set rightP = (width / 2) + (pictureWidth / 2)
set leftP = (width / 2) - (pictureWidth / 2)
-- place the caption on the page
if not(voidP(pictureCaption)) then
printObj(mSetTextJust,"left")
printObj(mSetTextSize,14)
printObj(mSetTextStyle,"normal,italic")
printObj(mDrawText, pictureCaption, 0, 30)
end if
printObj(mNewPage)
printObj(mPicture, the picture of cast pictureCast, leftP, topP, rightP, bottomP)
-- register the xobject
printobj(mRegister, "PMAT130-013-01075")
-- printObj(mPrintPreview)
printObj(mprint)
printObj(mDispose)
end
-- ----------------------------------------------------------------
-- Handler printingInvention returns TRUE if the user clicked the
-- print button in the gallery or an old invention movie and FALSE
-- otherwise.
on printingInvention
-- special clause for gallery movie so the dialog does not appear
-- in the index of the gallery
return ((the movieName = "Gallery.dir") and notInGalleryIndex()) or (the movieName contains "I_") or (the movieName = "quizgam.dir")
end
on notInGalleryIndex
return marker(0) >= label("AlarmClock")
end
-- ----------------------------------------------------------------
-- Handler doPrintCardSize does the actual printing of the screen
-- in four cards. It receives an instance of the printomatic xobj
-- as a parameter (that was created in either printScreenMAC or printScreenPC).
on doPrintCardSize printobj, fullFileName
printobj(mSetDocumentName, "Leonardo 2")
-- set up the new object:
-- 1) reset to page 1
printobj(mreset)
-- 2) set landscape mode
printobj(msetlandscapemode, TRUE)
-- 3) set the margins to as big as possible
set paperwidth = printobj(mgetpaperwidth)
set paperheight = printobj(mgetpaperheight)
printobj(msetmargins, 0, 0, paperwidth, paperheight)
-- 4) set the printable space to the margins
printobj(msetprintablemargins)
set pageH = printobj(mgetpageheight)
set pageW = printobj(mgetpagewidth)
-- 5) start a new page
printobj(mnewpage)
-- 6) put the four screenshots on the page
if voidP(fullFileName) then -- printing the screen
-- 6a) top left card
-- don't know why i need a -25 here, it should be -10, but
-- that seems to print bigger than the other cards for some reason
printobj(mstagepicture, 0, 0, pageW / 2, (pageH / 2) - 10)
-- 6b) bottom left card
printobj(mstagepicture, 0, pageH / 2,pageW / 2, pageH - 10)
-- 6c) top right card
printobj(mstagepicture, pageW / 2, 0, pageW, (pageH / 2) - 10)
-- 6d) bottom right card
printobj(mstagepicture, pageW / 2, pageH / 2, pageW, pageH - 10)
-- 6e) page footer left side: copyright notice
set width = printObj(mGetPageWidth)
set height = printObj(mGetPageheight)
printObj(mSetTextSize,10)
printObj(mSetTextStyle,"normal")
printObj (mSetTextJust,"left")
printObj (mDrawText,"⌐1996 SoftKey Multimedia Inc., a subsidiary of SoftKey International Inc.",0,height-2)
else -- printing a file
-- 6a) top left card
-- don't know why i need a -25 here, it should be -10, but
-- that seems to print bigger than the other cards for some reason
printobj(mpicture, fullFileName, 0, 0, pageW / 2, (pageH / 2) - 10)
-- 6b) bottom left card
printobj(mpicture, fullFileName, 0, pageH / 2, pageW / 2, pageH - 10)
-- 6c) top right card
printobj(mpicture, fullFileName, pageW / 2, 0, pageW, (pageH / 2) - 10)
-- 6d) bottom right card
printobj(mpicture, fullFileName, pageW / 2, pageH / 2, pageW, pageH - 10)
end if
-- 7) register the xobject
printobj(mRegister, "PMAT130-013-01075")
-- printObj(mprintPreview)
-- 8) print the page
printobj(mprint)
-- 9) get rid of the object
printobj(mdispose)
end